/*
 *  SpecialLinkedList1.h
 *  SpecialLinkedList1
 *
 *  Created by Hamza SHAWY on 07-11-26.
 *  Copyright 2007 __MyCompanyName__. All rights reserved.
 *
 */


#ifndef SPECIALLINKEDLIST1_H
#define SPECIALLINKEDLIST1_H

#include "SpecialLinkedList.h"


#include <iostream>
#include <sstream> //for istream to extract integers from a getline's string
#include <algorithm> //for count(string,int start,int end,char whatToCount)
using namespace std;

class SpecialLinkedList1 : public SpecialLinkedList
{
	public:
		SpecialLinkedList1();
		~SpecialLinkedList1();
		
		//note that we should return something in SomeType& only when we intend to return a reference to something which existed before the function was run
		//for example : returning/repassing a reference to an istream/ostream obtained in parameter (see operators >> and <<)
		//other example : for operator= we modify ourselves (using the this keyword or not because it's not necessary) and then return *this which existed before
		
		//we return something in Type with not & after, when we return something new
		//note that returning a SpecialLinkedList1 with no & is not a problem since this object only owns pointers,
		//so pointers are duplicated...
		//when doing something like L1 = L2+L3 (where operator+ is the function we care for and which returns a full SpecialLinkedList1 object (no & after))
		//then L1 = result TODO
		
		SpecialLinkedList1& operator=(SpecialLinkedList1 other); //modifies oneself in place and returns *this
		friend SpecialLinkedList1 operator+(SpecialLinkedList1& left, SpecialLinkedList1& right) ;
		friend SpecialLinkedList1 operator-(SpecialLinkedList1& left, SpecialLinkedList1& right) ;
		bool operator==(SpecialLinkedList1& other) ;
		int operator[](int index) ;
		friend ostream& operator<<(ostream&, SpecialLinkedList1&); //for cout << SpecialLinkedList1_instance
		friend istream& operator>>(istream&, SpecialLinkedList1&); //for cin >> SpecialLinkedList1_instance, and asks the user to enter integers to fill the list

};
ostream& operator<<(ostream& out, SpecialLinkedList1& other);
istream& operator>>(istream& in, SpecialLinkedList1& other);
SpecialLinkedList1 operator+(SpecialLinkedList1& left, SpecialLinkedList1& right) ;
SpecialLinkedList1 operator-(SpecialLinkedList1& left, SpecialLinkedList1& right) ;


#endif


